package cn.wolfcode.trip.base.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Getter
@Setter
public class Message extends BaseDomain {
    public static final Integer STATUS_UNREAD = 0; // 未读
    public static final Integer STATUS_READ = 1;   // 已读

    private User sender;    // 发送者id

    private User receiver;  // 接收者id

    private MessageInfo msgInfo;    // 信息内容对象

    private Integer status = STATUS_UNREAD; // 信息状态，已读/未读

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createtime;    // 创建时间
}